package com.aneliya.command.chatWindow;

import com.aneliya.framework.mvc.Facade;
import com.aneliya.framework.mvc.controller.ICommand;
import com.aneliya.framework.mvc.controller.MVCEvent;
import com.aneliya.mediator.ChatWindowMediator;
import com.aneliya.proxy.OnlineUsersProxy;

public class UpdateOnlineUsersCommand implements ICommand {

	public void execute(MVCEvent event) {
		try {
			ChatWindowMediator chatWindowMediator = 
				(ChatWindowMediator) Facade.getInstance().retrieveMediator("ChatWindowMediator");
			OnlineUsersProxy onlineUsersProxy = 
				(OnlineUsersProxy) Facade.getInstance().retrieveProxy("OnlineUsersProxy");
			
			chatWindowMediator.updateOnlineUsers(onlineUsersProxy.getOnlineUsers());
		} catch (Exception ex) {
			ex.printStackTrace();
		}

	}

}
